const layout = {
    d3Force: {
        type: 'd3-force',
        animation: false,
        link: {
            iterations: 4,
            distance: (d) => {
                return 60;
            },
            strength: (d) => {
                return 0.6;
            },
        },
        manyBody: {
            distanceMin: 0.8,
            strength: (d) => {
                return -45
            }
        },
        collide: {
            radius: 70,
            strength: 0.8,//力的强度，值越大排斥效果越明显
            iterations: 6
        },
        center: {
            strength: 0.05,
        },
    },
    d3Force1: {
        type: 'd3-force',
        animation: false,
        link: {
            iterations: 4,
            distance: (d) => {
                if (d.source.nodeType === '课程名') {
                    return 120;
                } else if (d.source.nodeType === '单元') {
                    return 90;
                } else {
                    return 70
                }
            },
            strength: (d) => {
                // 越大链接力越强
                if (d.source.nodeType === '单元' || d.source.nodeType === '知识点') {
                    return 0.6
                }
                return 0.2;
            }
        },
        manyBody: {
            strength: (d) => {
                // 越小节点的斥力越强
                if (d.data.nodeType === '课程名' || d.data.nodeType === '单元') {
                    return -80
                }
                return -50
            },
        },
        collide: {
            // iterations: 4,
            radius: 64,
            strength: 0.84,
        },
        center: {
            strength: 0.05,
        },
    },
    dagre: {
        type: 'dagre',
        rankdir: 'TB',
        align: 'UL',
        nodesep: 50,
        ranksep: 50,
        controlPoints: false,
    },
    antvDagre: {
        type: 'antv-dagre',
        // nodeSize: [60, 30],
        nodesep: 10,
        ranksep: 40,
        controlPoints: false,
        ranker: "tight-tree"
    },
    compactBox: {
        type: 'compact-box',
        direction: 'TB',
        nodeSep: 200,
        rankSep: 250,
        getHeight: function getHeight() {
            return 16;
        },
        getWidth: function getWidth() {
            return 16;
        },
        getVGap: function getVGap() {
            return 60;
        },
        getHGap: function getHGap(d) {
            if (d.data.nodeType === 'course' || d.data.nodeType === 'unit') {
                return 80
            }
            return 34;
        },
    },
    compactBox1: {
        type: 'compact-box',
        radial: true,
        direction: 'RL',
        getId: function getId(d) {
            return d.id;
        },
        getHeight: () => {
            return 26;
        },
        getWidth: () => {
            return 26;
        },
        getVGap: () => {
            return 20;
        },
        getHGap: (d) => {
            return 40;
        },
    },
    dendrogram: {
        type: 'dendrogram',
        direction: 'TB', // H / V / LR / RL / TB / BT
        nodeSep: 36,
        rankSep: 250,
    },
    force: {
        animation: false,
        type: 'force',
        clustering: true,
        nodeClusterBy: 'nodeType',
        clusterNodeStrength: 80,
        linkDistance: 60,
        preventOverlap: true,
        nodeSize: 120,
        nodeSpacing: 20,
        maxSpeed: 210,
    },
    forceAtlas2: {
        animation: false,
        type: 'force-atlas2',
        preventOverlap: true,
        kr: 68,
        nodeSize: 180,
    },
    fruchterman: {
        animation: false,
        type: 'fruchterman',
        clustering: false,
        nodeClusterBy: 'nodeType',
        gravity: 8,
        speed: 5,
        clusterGravity: 15
    },
    radial: {
        type: 'radial',
        nodeSize: 100,
        nodeSpacing: 20,
        sortBy: 'important',
        preventOverlap: true,
        sortStrength: 3.4,
        maxPreventOverlapIteration: 800,
        strictRadial: false,
    }
}
export default layout
